import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/AddPermission',
          name: 'AddPermission',
          component: () => import('../views/Permission/AddPermission.vue'),
        },
        {
          path: '/GetPermission',
          name: 'GetPermission',
          component: () => import('../views/Permission/GetPermission.vue'),
        },
        {
          path: '/UpdatePermission',
          name: 'UpdatePermission',
          component: () => import('../views/Permission/UpdatePermission.vue'),
        },
        {
          path: '/AddUser',
          name: 'AddUser',
          component: () => import('../views/User/AddUser.vue'),
        },
        {
          path: '/GetUser',
          name: 'GetUser',
          component: () => import('../views/User/GetUser.vue'),
        },
        {
          path: '/UpdateUser',
          name: 'UpdateUser',
          component: () => import('../views/User/UpdateUser.vue'),
        },
        {
          path: '/AddRole',
          name: 'AddRole',
          component: () => import('../views/Role/AddRole.vue'),
        },
        {
          path: '/GetRole',
          name: 'GetRole',
          component: () => import('../views/Role/GetRole.vue'),
        },
        {
          path: '/UpdateRole',
          name: 'UpdateRole',
          component: () => import('../views/Role/UpdateRole.vue'),
        },
      ]
    },
    {
      path: '/',
      name: 'Login',
      component: () => import('../views/Login.vue'),
    },

  ],
})

export default router
